package com.shitou.springai1.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.shitou.springai1.admin.entity.dto.PostDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface PostMapper extends BaseMapper<PostDto> {
    // 分页查询言论列表，支持内容模糊搜索、时间区间筛选、状态筛选和点赞数排序
    IPage<PostDto> selectPostsByPage(
            Page<PostDto> page,
            @Param("keyword") String keyword,
            @Param("startDate") String startDate,
            @Param("endDate") String endDate,
            @Param("status") Integer status,
            @Param("likeOrder") String likeOrder
    );
}
